package me.ywy.kotlinvideo.utils

import me.ywy.kotlinvideo.base.BaseFragment
import me.ywy.kotlinvideo.ui.fragment.HomeFragment
import me.ywy.kotlinvideo.ui.fragment.MVFragment
import me.ywy.kotlinvideo.ui.fragment.MVListFragment
import me.ywy.kotlinvideo.ui.fragment.VListFragment

/**
 * Created by ywy on 2018-11-05.
 */
class FragmentUtil private constructor() {
    val homeFragment by lazy{HomeFragment()}
    val mvFragment by lazy{ MVFragment() }
    val vListFragment by lazy{VListFragment()}
    val mvListFragment by lazy{MVListFragment()}

    companion object {
        val fragmentUtil by lazy{FragmentUtil()}

    }


    fun getFragment(position:Int):BaseFragment?{
        return when(position){
            0->homeFragment
            1->mvFragment
            2->vListFragment
            3->mvListFragment
            else->null
        }
    }

}